<html>

<head>
    <meta charset="utf-8">
    <title>基利斯SAAS系统-登录</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="icon" href="/favicon.ico">
    <link rel="stylesheet" href="{$htmlStaticPath}/layui/css/layui.css?v={$htmlVersion}" media="all" />
    <link id="layuicss-layer" rel="stylesheet" href="{$htmlStaticPath}/layui/css/modules/layer/default/layer.css?v={$htmlVersion}" media="all">
    <link rel="stylesheet" href="{$htmlStaticPath}/css/login.css?v={$htmlVersion}" media="all">
</head>

<body class="layui-layout-body">
    <div class="loginbody">
        <div class="loginbanner">
            <div class="w1200">
                <form class="layui-form" action="" method="post">
                    <div class="loginform layui-form-item">
                        <div class="">
                            <img src="{$htmlStaticPath}/images/login/login-logo.png" alt="基利斯SAAS系统">
                        </div>
                        <div class="layui-input-div">
                            <input type="text" name="account" required lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input inputicon01">
                        </div>
                        <div class="layui-input-div">
                            <input type="password" name="password" required lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input inputicon02">
                        </div>
                        <div class="layui-input-div">
                            <input style="width: 160px;" type="text" name="code" required lay-verify="required" placeholder="请输入验证码" autocomplete="off" class="layui-input layui-yzm">
                            <img src="{:captcha_src()}?1" alt="验证码" class="layui-yzmimg" id="img-code">
                        </div>
                        <div class="layui-input-div">
                            <button class="layui-btn search_btn loginbutton" id="savebtn" lay-submit="" lay-filter="login">登录</button>
                            <!-- <a href="#" class="fogetpswd">忘记密码？</a> -->
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="{$htmlStaticPath}/jquery.js?v={$htmlVersion}"></script>
	<script type="text/javascript" src="{$htmlStaticPath}/layui/layui.js?v={$htmlVersion}"></script>
    <script type="text/javascript" src="{$htmlStaticPath}/lib/jquery.md5.js?v={$htmlVersion}"></script>
    <script>
        //JavaScript代码区域
        layui.use('form', function (form) {
            
            form.on("submit(login)",function(data){
                var account = data.field.account;
                var password = $.md5(data.field.password);
                var code = data.field.code;
                layer.load(3);
                $.post("/passport/login",{account:account,password:password,code:code},function(ret){
                    layer.closeAll();
                    if(ret.code==1){
                        layer.msg(ret.msg,{icon:6});
                        setTimeout(function () {
                            window.parent.location.href = ret.url;
                        }, 2000);
                    }else{
                        $("#img-code").click();
                        layer.msg(ret.msg,{icon:5});
                    }
                },"json");
                return false;
            })

            $("#img-code").click(function () {
                var url = $(this).prop("src") + 1;
                $(this).prop("src", url);
            })
        });
    </script>
</body>

</html>